let content = document.querySelector(".content");

// console.log(content);
let xhr = new XMLHttpRequest();
xhr.open(
    "get",
    `/my/movie/v2/list/hot.json?limit=12&offset=0&ct=广州`
);
xhr.send();
xhr.onload = function () {

    let res = JSON.parse(xhr.responseText);
    console.log(res.data.hot);
    render(res.data.hot)
    // console.log(1);
};

function render(data) {   
    console.log(data);
    let str = ""
    data.forEach(item => {
        str += ` 
        <a href="../html/details.html?id=${item.videoId}">
        <div class="main-block">
        <div class="imgBox"><img src="${item.img.replace("w.h/","")}"></div>
        <div class="recommend">
            <div>
                <div>${item.nm}</div>
                <span>${item.cat}</span>
                <div>${item.desc}</div>
                <span>${item.rt}</span>
                <span>${item.showTimeInfo}</span>
            </div>
            <div>
                <p><i>126565</i>人想看</p>
                <span>预售</span>
            </div>
        </div>
    </div></a>`
    });
    content.innerHTML =str;
}